﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="clr-namespace:ProjectEuler.UI">

    <!--
    Rather than forcing *all* TextBlocks to adopt TextBlockService styles,
    using x:Key allows a more friendly opt-in model.
    -->
    <Style TargetType="{x:Type TextBlock}" x:Key="{x:Static ui:TextBlockService.AutoToolTipStyleKey}">
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="ui:TextBlockService.AutoToolTipEnabled" Value="True" />
                    <Condition Property="ui:TextBlockService.IsTextTrimmed" Value="True" />
                </MultiTrigger.Conditions>

                <Setter Property="ToolTip" Value="{Binding Text, RelativeSource={RelativeSource Self}}" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>